from flask import Blueprint
from .view import *

ai_blueprint = Blueprint('ai_blueprint', __name__)

# 上传文件
ai_blueprint.add_url_rule(rule='/file/upload', methods=['POST'], view_func=upload_file)
# 删除所有文件
ai_blueprint.add_url_rule(rule='/file/deleteAll', methods=['POST'], view_func=delete_all_file)
# 删除一个文件
ai_blueprint.add_url_rule(rule='/file/deleteOne', methods=['POST'], view_func=delete_one_file)
# 列出所有文件
ai_blueprint.add_url_rule(rule='/file/list',methods=['POST'], view_func=list_file)
# 对选中的文件建立索引
ai_blueprint.add_url_rule(rule='/embeddings/add',methods=['POST'], view_func=generate_embeddings)
# 删除所有索引
ai_blueprint.add_url_rule(rule='/embeddings/delete',methods=['POST'], view_func=delete_embeddings)
# 流式问答
ai_blueprint.add_url_rule(rule='/embeddings/query',methods=['GET','POST'],view_func=ask_stream2)
# 生成知识地图
ai_blueprint.add_url_rule(rule='/graph/generate',methods=['POST'],view_func=generate_graph)